
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.EvQuestionDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class EvQuestionDaoJdbc extends BaseDaoJdbc implements EvQuestionDao {
	String tableName="T_EV_QUESTION";
	String beanName="evQuestion";
	
	public CommonBean createEvQuestion(){
		CommonBean evQuestions=this.createBean(tableName,beanName);
                return evQuestions;		
	}
	
/*
	public CommonBean findEvQuestions(String refid) {
		CommonBean evQuestions=this.createEvQuestion();
		String sql="select * from T_EV_QUESTION where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		evQuestions.addData(data);
                return evQuestions;
       }
*/
	public CommonBean findEvQuestionById(String id) {
		CommonBean evQuestions=this.createEvQuestion();
		String sql="select * from T_EV_QUESTION where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		evQuestions.addData(data);
    return evQuestions;
  }
  
	public CommonBean findAllEvQuestions() {
		CommonBean evQuestions=this.createEvQuestion();
		String sql="select * from T_EV_QUESTION ";
		List data=this.getCommonDao().select(sql,new String[]{});
		evQuestions.addData(data);
    return evQuestions;
  }
	public void insertEvQuestion(CommonBean evQuestionBean){
		List data=evQuestionBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
	public void updateEvQuestion(CommonBean evQuestionBean){
		List data=evQuestionBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchUpdate(row,data);
	}
}

